﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LanceZhang.Research.BLL;
using LanceZhang.Research.Model;

public partial class UserControl_MyResearch : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        TBL_UserModel user = (TBL_UserModel)Session["UM"];
        string id = user.UserID;
        TBL_Reserch bookcontrl = new TBL_Reserch();
        grdMain.DataSource = bookcontrl.GetList(" ProjectID in (select ProjectID from TBL_ProjectMember where UserID='" + id + "')");
        grdMain.DataBind();
    }
    protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Response.Redirect("ResearchDetail.aspx?id=" + grdMain.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString());
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Response.Redirect("AddResearch.aspx");
    }
}
